import request from '@/utils/request'

export function add(data) {
  return request({
    url: 'api/cabinet',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: 'api/cabinet/',
    method: 'delete',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'api/cabinet',
    method: 'put',
    data
  })
}

export function getCabinet(data) {
  return request({
    url: 'api/cabinet',
    method: 'get',
    data
  })
}

export function openDoor(params) {
  return request({
    url: 'api/cabinet/openDoor',
    method: 'post',
    params
  })
}

export function closeDoor(params) {
  return request({
    url: 'api/cabinet/closeDoor',
    method: 'post',
    params
  })
}

export function getAllCabinetsAPI () {
  return request({
    url: 'api/cabinet/cabinetAllList'
  })
}
export default { add, edit, del }
